<script>
    var obj = { width: 100 };

    var proxy = new Proxy(obj, {
        get: function (target,key,receiver) {
            console.log(target,key,receiver);
            console.log("调用属性开始");
            let result=Reflect.get(target,key,receiver);
            console.log("调用属性结束");
            return result;
        },
        set:function(target,key,value,receiver){
            console.log(target,key,value,receiver);
            console.log("设置属性前");
            Reflect.set(target,key,value,receiver);
            console.log("设置属性后");
        }
    });
    
    proxy.width=200;
    console.log(proxy.width);
</script>